<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取像素的html</title>
</head>
<body>
  <div id="pxHeight"></div>
  <div id="pxWidth"></div>
</body>
<script>
    document.getElementById("pxHeight").innerHTML="此屏幕的height："+window.screen.availHeight;
    document.getElementById("pxWidth").innerHTML="此屏幕的width："+window.screen.availWidth;
</script>
</html>